#include"common.hpp"

class Command{
public:
    Command(){}

    std::string Excute(const std::string& command, Inetaddr& addr)
    {   
        FILE* fp = popen(command.c_str(),"r");
        if(NULL == fp)
        {
            return std::string("no find your cmd: ") + command;
        }
        
        std::string res;
        char line[1024];
        while(fgets(line,sizeof(line),fp))
        {
            res += line;
        }
        pclose(fp);
        std::string result = addr.String_addr() + "cmd# \n"+ res;
        return result;
    }

    ~Command(){}

private:

};